<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <meta name="author" content="程月">
    <title>订单</title>
    <style>
        * {
            box-sizing: border-box;
        }

        body {
            margin: 0;
        }

        ul {
            margin: 0;
            padding: 0;
            list-style: none;
        }

        a {
            text-decoration: none;
            font-size: inherit;
            color: inherit;
        }
        main{
            width: 200px;
            height: 30px;
            margin: 200px auto;
            text-align: center;
            position: relative;
        }
        .left{
            float: left;
        }
        .right{
            float: right;
        }
        div{
            width: 49.9%;
            line-height: 30px;
            text-align: center;
            border: 1px  solid  #aaa;
            position: relative;
        }
        ul{
            position: absolute;
            width: 100%;
            display: none;
        }
         li{
            border: 1px  solid #aaa;
        }
        p{
            position: absolute;
             /* bottom: 0px;  */
              top: 140px; 
              left: 75px;
             width: 50px;
             margin: 0 auto;
             text-align: center;
        }
    </style>
</head>

<body>
    <main>
        <div class="left">
            <a href="#" class="btn1">销售订单</a>
            <ul class="left-ul">
                <li><a href="#">订单1</a></li>
                <li><a href="#">订单2</a></li>
                <li><a href="#">订单3</a></li>
            </ul>
        </div>
        <div class="right">
            <a href="#" class="btn2">消费订单</a>
            <ul class="right-ul">
                <li><a href="#">消费1</a></li>
                <li><a href="#">消费2</a></li>
                <li><a href="#">消费3</a></li>
            </ul>
        </div>
        <p>00</p>
    </main>
    <script src="./jquery.js"></script>
</body>
</html>

<script>
    $('.btn1').click(function(){
        $('.left-ul').css('display','block');
    });

    $('.left-ul').hover(function(){
         $('.left-ul li').mouseover(function(){
            $(this).css('background-color','#aaa').siblings().css('background-color','#fff');
      });},function(){
         $('.left-ul').css('display','none');
      }
    );

    $('.btn2').click(function(){
        $('.right-ul').css('display','block');
    });

    $('.right-ul').hover(function(){
         $('.right-ul li').mouseover(function(){
            $(this).css('background-color','#aaa').siblings().css('background-color','#fff');
      });},function(){
         $('.right-ul').css('display','none');
      }
    );

    $('li').click(function(){
        $('p').text($(this).text());
        $('ul').css('display','none');
    });
   
</script>